﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace yieldLearning
{
    class Program
    {
        public static int[] ints = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 };

        public static IEnumerable<int> GetEven()
        {
            foreach (var i in ints)
            {
                if (i % 2 == 0)
                {
                    yield return i;
                }
            }
        }

        static void Main(string[] args)
        {
            // Display the even numbers.
            Console.WriteLine("Even numbers");
            foreach (int i in GetEven())
                Console.WriteLine(i);

            Console.ReadLine();
        }
    }
}
